package hyg.q3;

import java.util.Scanner;
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int n = 10;
        for (int i = 1 ; i < 50 ;i++) {
            System.out.println("i = " + i + "  "+getFiboNR(i));
        }
        for (int i = 1 ; i < 50 ;i++) {
            System.out.println("i = " + i + "  "+getFibo(i));
        }
    }

    private static int getFiboNR(int n) {
        if (n == 1 || n == 2)
            return 1;
        int sum=0,n1=1,n2=1;
        for (int i = 3 ; i <= n ; i++){
            sum = n1 + n2;
            n2 = n1;
            n1 = sum;
        }
        return sum;
    }

    private static int getFibo(int i) {
        if (i==1 || i == 0)
            return 1;
        return getFibo(i - 1) + getFibo(i - 2);
    }


}
